function createSearchManager() {
      let requestId = 0
      let currentId = 0
      let timer = null

      return function (keyword) {
        if (keyword == '') {
          clearTimeout(timer)
          console.log('重新搜索');
          return
        }
        // 请补充代码
        // 1. 匹配字典
        let str = '猜你想搜：'
        const res = hotKeys.filter((item) => {
          item = item.toLowerCase()
          keyword = keyword.toLowerCase()
          return item.includes(keyword)
        })
        if (res.length) {
          str += res.join(',')
          console.log(str);
        }

        // 2. 
        clearTimeout(timer)
        timer = setTimeout(() => {
          if (currentId === requestId) {
            currentId++
            return searchGoods(keyword).then(res => {
              requestId++
              console.log(res);
            })
          }
        }, 500)

      };
    }

    const searchManager = createSearchManager();